package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.TAttachmentMapper;
import com.ruoyi.system.domain.TAttachment;
import com.ruoyi.system.service.ITAttachmentService;
import com.ruoyi.common.core.text.Convert;

/**
 * 附件信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-03-20
 */
@Service
public class TAttachmentServiceImpl implements ITAttachmentService 
{
    @Autowired
    private TAttachmentMapper tAttachmentMapper;

    /**
     * 查询附件信息
     * 
     * @param id 附件信息主键
     * @return 附件信息
     */
    @Override
    public TAttachment selectTAttachmentById(Long id)
    {
        return tAttachmentMapper.selectTAttachmentById(id);
    }

    /**
     * 查询附件信息列表
     * 
     * @param tAttachment 附件信息
     * @return 附件信息
     */
    @Override
    public List<TAttachment> selectTAttachmentList(TAttachment tAttachment)
    {
        return tAttachmentMapper.selectTAttachmentList(tAttachment);
    }

    /**
     * 新增附件信息
     * 
     * @param tAttachment 附件信息
     * @return 结果
     */
    @Override
    public int insertTAttachment(TAttachment tAttachment)
    {
        tAttachment.setCreateTime(DateUtils.getNowDate());
        return tAttachmentMapper.insertTAttachment(tAttachment);
    }

    /**
     * 修改附件信息
     * 
     * @param tAttachment 附件信息
     * @return 结果
     */
    @Override
    public int updateTAttachment(TAttachment tAttachment)
    {
        tAttachment.setUpdateTime(DateUtils.getNowDate());
        return tAttachmentMapper.updateTAttachment(tAttachment);
    }

    /**
     * 批量删除附件信息
     * 
     * @param ids 需要删除的附件信息主键
     * @return 结果
     */
    @Override
    public int deleteTAttachmentByIds(String ids)
    {
        return tAttachmentMapper.deleteTAttachmentByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除附件信息信息
     * 
     * @param id 附件信息主键
     * @return 结果
     */
    @Override
    public int deleteTAttachmentById(Long id)
    {
        return tAttachmentMapper.deleteTAttachmentById(id);
    }

    @Override
    public List<TAttachment> selectTAttachmentListByAttachId(TAttachment tAttachment) {
        return tAttachmentMapper.selectTAttachmentListByAttachId(tAttachment);
    }

    @Override
    public List<TAttachment> selectHouseTAttachmentList(TAttachment tAttachment) {
        return tAttachmentMapper.selectHouseTAttachmentList(tAttachment);
    }

    @Override
    public List<TAttachment> selectLandTAttachmentList(TAttachment tAttachment) {
        return tAttachmentMapper.selectLandTAttachmentList(tAttachment);
    }
}
